// 导入axios
import service from '@/utils/request'

// 封装获取-分页查询角色列表接口/sys/role
export function getRoleRequest(params) {
  return service({
    method: 'get',
    url: '/sys/role',
    params
  })
}
// 封装新增角色接口 /sys/role
export function setSysroleRequest(data) {
  return service({
    method: 'post',
    url: '/sys/role',
    data
  })
}
// 封装删除角色接口
export function deleteSysroleRequest(id) {
  return service({
    method: 'delete',
    url: `/sys/role/${id}`
  })
}
// 封装修改角色接口 /sys/role/{id}
export function updataSysRoleRequest(data) {
  return service({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}
// 封装获取-已启用的角色列表接口 /sys/role/list/enabled
export function getenabledRequest() {
  return service({
    method: 'get',
    url: '/sys/role/list/enabled'
  })
}

// 获取-角色详情 /sys/role/{id}
export function getassignPremRequest(id) {
  return service({
    method: 'get',
    url: `/sys/role/${id}`
  })
}

// 封装分配权限-角色 /sys/role/assignPrem
export function updataassignPremRequest(data) {
  return service({
    method: 'put',
    url: '/sys/role/assignPrem',
    data
  })
}
